package models;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import play.db.jpa.Model;

@Entity
@Table(name = "Events_Users", uniqueConstraints = { @UniqueConstraint(columnNames = {
		"user_id", "event_id" }) })
public class EventUser extends Model {

	public boolean attendance;

	@ManyToOne
	@JoinColumn(name = "user_id")
	public User user;

	@ManyToOne
	@JoinColumn(name = "event_id")
	public Event event;
	
	public EventUser(User user, Event event)
	{
		this.user = user;
		this.event = event;
		attendance=false;
	}

}